Can"t locate <module>.pm in @INC even though it path exists and worksoutside mod_perl

Can"t locate <module>.pm in @INC even though it path exists and worksoutside mod_perl

am 18.12.2010 08:17:43 von ArulJothi

--000325575ae64034ab0497aa1560
Content-Type: text/plain; charset=ISO-8859-1

Dear Friends,

I have started using mod_perl recently and facing following difficulties in
terms of running a script which depends on some custom (home grown) modules.

When i execute Apache error log reports that it cannot locate the module in
@INC path even though the path very much exists and i am able to run the
script without any issues outside mod_perl

Basically, Here is my setup

1) Modules are located under /opt/tools/perl/lib
2) @INC containts /opt/tools/perl/lib
- This is also confirmed by http://localhost/perl-status
3) Web perl scripts are located at /var/www/perl and apache is properly
configured
- This is confirmed by executing a script which does not
depend on any external modules
4) Now if i execute a perl script which has "use ;" pragma, it
fails if this module is located under custom path, but works well for
modules which are intalled with perl distribution

Any clue is appreciated.

Thanks in advance,
Aruljothi.S

--000325575ae64034ab0497aa1560
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Dear Friends,

=A0I have started using mod_perl recently and facing f=
ollowing difficulties in terms of running a script which depends on some cu=
stom (home grown) modules.

=A0When i execute Apache error log report=
s that it cannot locate the module in @INC path even though the path very m=
uch exists and i am able to run the script without any issues outside mod_p=
erl


=A0Basically, Here is my setup

=A01) Modules are located under /=
opt/tools/perl/lib
=A02) @INC containts /opt/tools/perl/lib
  =A0=
           - This is also confirmed by //localhost/perl-status">http://localhost/perl-status

=A03) Web perl scripts are located at /var/www/perl and apache is properly =
configured
              - This is confirmed by =
executing a script which does not depend on any external modules
=A04) N=
ow if i execute a perl script which has "use <module>;" pra=
gma, it fails if this module is located under custom path, but works well f=
or modules which are intalled with perl distribution


=A0Any clue is appreciated.

Thanks in advance,
Aruljothi.S >

--000325575ae64034ab0497aa1560--

Re: Can"t locate <module>.pm in @INC even though it path exists andworks outside mod_perl

am 18.12.2010 10:21:30 von aw

ArulJothi wrote:
> Dear Friends,
>
> I have started using mod_perl recently and facing following difficulties in
> terms of running a script which depends on some custom (home grown) modules.
>
> When i execute Apache error log reports that it cannot locate the module in
> @INC path even though the path very much exists and i am able to run the
> script without any issues outside mod_perl
>
> Basically, Here is my setup
>
> 1) Modules are located under /opt/tools/perl/lib
> 2) @INC containts /opt/tools/perl/lib
> - This is also confirmed by http://localhost/perl-status
> 3) Web perl scripts are located at /var/www/perl and apache is properly
> configured
> - This is confirmed by executing a script which does not
> depend on any external modules
> 4) Now if i execute a perl script which has "use ;" pragma, it
> fails if this module is located under custom path, but works well for
> modules which are intalled with perl distribution
>
> Any clue is appreciated.
>
When it fails, there is an error message in the Apache log.
What /exactly/ does that message say ? (copy it here)

Re: Can"t locate <module>.pm in @INC even though it path exists and works outside mod_perl

am 18.12.2010 11:42:16 von torsten.foertsch

On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
> When i execute Apache error log reports that it cannot locate the module
> in @INC path even though the path very much exists and i am able to run
> the script without any issues outside mod_perl
>=20
> Basically, Here is my setup
>=20
> 1) Modules are located under /opt/tools/perl/lib
> 2) @INC containts /opt/tools/perl/lib
> - This is also confirmed by http://localhost/perl-status
> 3) Web perl scripts are located at /var/www/perl and apache is properly
> configured
> - This is confirmed by executing a script which does not
> depend on any external modules
> 4) Now if i execute a perl script which has "use ;" pragma, it
> fails if this module is located under custom path, but works well for
> modules which are intalled with perl distribution

Are you sure the scripts are run by mod_perl instead of mod_cgi? If you are=
=20
using mod_cgi use SetEnv to propagate the custom search path to the module.

Torsten Förtsch

=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Re: Can"t locate <module>.pm in @INC even though it path exists andworks outside mod_perl

am 18.12.2010 14:18:21 von ArulJothi

--0022152d60a9f5c5260497af1ee9
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

Thanks for looking into the issue.

I think i am running using mod_perl and not mod_cgi, but How to identify i=
t
properly.

Anyway here is my error details

*URL of my execution:* http://localhost/opt/bi.pl

*Content of bi.pl:*
$ cat bi.pl
use od_os;
print "hi\n";

* Location of od_os.pm on web server*
$ ls /opt/tools/perl/od_cmn/lib/od_os.pm
/opt/tools/perl/od_cmn/lib/od_os.pm

* Error on Apache server log*
[Sat Dec 18 18:41:38 2010] [error] Can't locate od_os.pm in @INC (@INC
contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib
/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-mult i
/usr/local/lib/perl5/site_perl/5.10.0
/usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
/usr/lib/perl5/site_perl . /etc/httpd) at /var/www/optim/bi.pl line
1.\nBEGIN failed--compilation aborted at /var/www/optim/bi.pl line 1.\n

Thanks & Regards,
Aruljothi.S

2010/12/18 Torsten Förtsch

> On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
> > When i execute Apache error log reports that it cannot locate the modu=
le
> > in @INC path even though the path very much exists and i am able to run
> > the script without any issues outside mod_perl
> >
> > Basically, Here is my setup
> >
> > 1) Modules are located under /opt/tools/perl/lib
> > 2) @INC containts /opt/tools/perl/lib
> > - This is also confirmed by http://localhost/perl-status
> > 3) Web perl scripts are located at /var/www/perl and apache is properl=
y
> > configured
> > - This is confirmed by executing a script which does not
> > depend on any external modules
> > 4) Now if i execute a perl script which has "use ;" pragma, it
> > fails if this module is located under custom path, but works well for
> > modules which are intalled with perl distribution
>
> Are you sure the scripts are run by mod_perl instead of mod_cgi? If you a=
re
> using mod_cgi use SetEnv to propagate the custom search path to the modul=
e.
>
> Torsten Förtsch
>
> --
> Need professional modperl support? Hire me! (http://foertsch.name)
>
> Like fantasy? http://kabatinte.net
>

--0022152d60a9f5c5260497af1ee9
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

=A0Thanks for looking into the issue.

=A0I t=
hink i am running using mod_perl and not mod_cgi, but How to identify it pr=
operly.

=A0Anyway here is my error details

=A0URL of my ex=
ecution:
http://localhost/opt/bi=
..pl



=A0Content of :
=A0$ cat href=3D"http://bi.pl">bi.pl
  =A0 use od_os;
  =A0 print=
"hi\n";

=A0Location of od_=
os.pm
on web server


=A0$ ls /opt/tools/perl/od_cmn/lib/=

/opt/tools/perl/od_cmn/lib/ >
=A0Error on Apache server log
[Sat Dec 18 18:41:38 2010] [er=
ror] Can't locate in @INC (@IN=
C contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib /usr/local/l=
ib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site=
_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr=
/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.1=
0.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl =
.. /etc/httpd) at /var/www/optim/ line 1.\=
nBEGIN failed--compilation aborted at /var/www/optim/ l">bi.pl line 1.\n


Thanks & Regards,
Aruljothi.S

=
2010/12/18 Torsten Förtsch < n.foertsch@gmx.net">torsten.foertsch@gmx.net>
class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); m=
argin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:<=
br>
> =A0When i execute Apache error log reports that it cannot locate the m=
odule

> in @INC path even though the path very much exists and i am able to ru=
n

> the script without any issues outside mod_perl

>

> =A0Basically, Here is my setup

>

> =A01) Modules are located under /opt/tools/perl/lib

> =A02) @INC containts /opt/tools/perl/lib

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is also confirmed by p://localhost/perl-status" target=3D"_blank">http://localhost/perl-status a>

> =A03) Web perl scripts are located at /var/www/perl and apache is prop=
erly

> configured

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is confirmed by executing a script =
which does not

> depend on any external modules

> =A04) Now if i execute a perl script which has "use <module>=
;;" pragma, it

> fails if this module is located under custom path, but works well for<=
br>
> modules which are intalled with perl distribution



Are you sure the scripts are run by mod_perl instead of mod_cgi? If y=
ou are

using mod_cgi use SetEnv to propagate the custom search path to the module.=




Torsten Förtsch



--

Need professional modperl support? Hire me! (
e" target=3D"_blank">http://foertsch.name)



Like fantasy? http://kab=
atinte.net





--0022152d60a9f5c5260497af1ee9--

Re: Can"t locate <module>.pm in @INC even though it path exists andworks outside mod_perl

am 18.12.2010 15:06:07 von ArulJothi

--00221532c778d427070497afc9de
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

I just found the solution, it is very silly. /opt/optimtools points to a
directory under a user home directory which does not have enough permission=
s
on home directory to read.

Anyway thanks for the effort.

Thanks & Regards,,
Aruljothi.S

2010/12/18 ArulJothi

> Torsten Fortsch,
>
> Thanks for looking into the issue.
>
> I think i am running using mod_perl and not mod_cgi, but How to identify
> it properly.
>
> Anyway here is my error details
>
> *URL of my execution:* http://localhost/opt/bi.pl
>
> *Content of bi.pl:*
> $ cat bi.pl
> use od_os;
> print "hi\n";
>
> * Location of od_os.pm on web server*
> $ ls /opt/tools/perl/od_cmn/lib/od_os.pm
> /opt/tools/perl/od_cmn/lib/od_os.pm
>
> * Error on Apache server log*
> [Sat Dec 18 18:41:38 2010] [error] Can't locate od_os.pm in @INC (@INC
> contains: /opt/tools/perl/cmn/lib /opt/tools/perl/od_cmn/lib
> /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-mult i
> /usr/local/lib/perl5/site_perl/5.10.0
> /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
> /usr/lib/perl5/site_perl . /etc/httpd) at /var/www/optim/bi.pl line
> 1.\nBEGIN failed--compilation aborted at /var/www/optim/bi.pl line 1.\n
>
> Thanks & Regards,
> Aruljothi.S
>
> 2010/12/18 Torsten Förtsch
>
> On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:
>> > When i execute Apache error log reports that it cannot locate the
>> module
>> > in @INC path even though the path very much exists and i am able to ru=
n
>> > the script without any issues outside mod_perl
>> >
>> > Basically, Here is my setup
>> >
>> > 1) Modules are located under /opt/tools/perl/lib
>> > 2) @INC containts /opt/tools/perl/lib
>> > - This is also confirmed by http://localhost/perl-status
>> > 3) Web perl scripts are located at /var/www/perl and apache is proper=
ly
>> > configured
>> > - This is confirmed by executing a script which does not
>> > depend on any external modules
>> > 4) Now if i execute a perl script which has "use ;" pragma, i=
t
>> > fails if this module is located under custom path, but works well for
>> > modules which are intalled with perl distribution
>>
>> Are you sure the scripts are run by mod_perl instead of mod_cgi? If you
>> are
>> using mod_cgi use SetEnv to propagate the custom search path to the
>> module.
>>
>> Torsten Förtsch
>>
>> --
>> Need professional modperl support? Hire me! (http://foertsch.name)
>>
>> Like fantasy? http://kabatinte.net
>>
>
>

--00221532c778d427070497afc9de
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Torsten Fortsch,

=A0I just found the solution, it is very silly. /op=
t/optimtools points to a directory under a user home directory which does n=
ot have enough permissions on home directory to read.

=A0Anyway than=
ks for the effort.


Thanks & Regards,,
Aruljothi.S

>2010/12/18 ArulJothi < il.com">aruljothi@gmail.com>
ote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0p=
t 0.8ex; padding-left: 1ex;">
Torsten Fortsch,

=A0Thanks for looking into the issue.

=A0I t=
hink i am running using mod_perl and not mod_cgi, but How to identify it pr=
operly.

=A0Anyway here is my error details

=A0URL of my ex=
ecution:
http:=
//localhost/opt/bi.pl




=A0Content of :<=
/b>
=A0$ cat
=A0=
   use od_os;
  =A0 print "hi\n";

=A0Locatio=
n of on web serv=
er



=A0$ ls /opt/tools/perl/od_cmn/lib/ lank">od_os.pm
/opt/tools/perl/od_cmn/lib/ m" target=3D"_blank">od_os.pm

=A0Error on Apache server log b>
[Sat Dec 18 18:41:38 2010] [error] Can't locate /od_os.pm" target=3D"_blank">od_os.pm in @INC (@INC contains: /opt/tool=
s/perl/cmn/lib /opt/tools/perl/od_cmn/lib /usr/local/lib/perl5/site_perl/5.=
10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib=
/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_per=
l/5.10.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.10.0/i386-linux-thread=
-multi /usr/lib/perl5/5.10.0 /usr/lib/perl5/site_perl . /etc/httpd) at /var=
/www/optim/ line 1.\nBE=
GIN failed--compilation aborted at /var/www/optim/ target=3D"_blank">bi.pl line 1.\n



Thanks & Regards,
Aruljothi.S

=
2010/12/18 Torsten Förtsch < n.foertsch@gmx.net" target=3D"_blank">torsten.foertsch@gmx.net> n>


"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padd=
ing-left: 1ex;">
On Saturday, December 18, 2010 08:17:43 ArulJothi wrote:

> =A0When i execute Apache error log reports that it cannot locate the m=
odule

> in @INC path even though the path very much exists and i am able to ru=
n

> the script without any issues outside mod_perl

>

> =A0Basically, Here is my setup

>

> =A01) Modules are located under /opt/tools/perl/lib

> =A02) @INC containts /opt/tools/perl/lib

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is also confirmed by p://localhost/perl-status" target=3D"_blank">http://localhost/perl-status a>

> =A03) Web perl scripts are located at /var/www/perl and apache is prop=
erly

> configured

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 - This is confirmed by executing a script =
which does not

> depend on any external modules

> =A04) Now if i execute a perl script which has "use <module>=
;;" pragma, it

> fails if this module is located under custom path, but works well for<=
br>
> modules which are intalled with perl distribution



Are you sure the scripts are run by mod_perl instead of mod_cgi? If y=
ou are

using mod_cgi use SetEnv to propagate the custom search path to the module.=




Torsten Förtsch



--

Need professional modperl support? Hire me! (
e" target=3D"_blank">http://foertsch.name)



Like fantasy? http://kab=
atinte.net







--00221532c778d427070497afc9de--